<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/doctrine/BaseFormFilterDoctrine.class.php');

/**
 * Sistema filter form base class.
 *
 * @package    filters
 * @subpackage Sistema *
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 11675 2008-09-19 15:21:38Z fabien $
 */
class BaseSistemaFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_sistema_pai'   => new sfWidgetFormDoctrineChoice(array('model' => 'Sistema', 'add_empty' => true)),
      'nm_sistema'       => new sfWidgetFormFilterInput(),
      'ds_sobre'         => new sfWidgetFormFilterInput(),
      'ds_servico'       => new sfWidgetFormFilterInput(),
      'ds_contato'       => new sfWidgetFormFilterInput(),
      'ds_marketing'     => new sfWidgetFormFilterInput(),
      'ds_twitter'       => new sfWidgetFormFilterInput(),
      'ds_facebook'      => new sfWidgetFormFilterInput(),
      'ds_youtube'       => new sfWidgetFormFilterInput(),
      'ds_flickr'        => new sfWidgetFormFilterInput(),
      'ds_orkut'         => new sfWidgetFormFilterInput(),
      'ds_institucional' => new sfWidgetFormFilterInput(),
      'ds_publico'       => new sfWidgetFormFilterInput(),
      'ds_destaque'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'id_sistema_pai'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Sistema', 'column' => 'id_sistema')),
      'nm_sistema'       => new sfValidatorPass(array('required' => false)),
      'ds_sobre'         => new sfValidatorPass(array('required' => false)),
      'ds_servico'       => new sfValidatorPass(array('required' => false)),
      'ds_contato'       => new sfValidatorPass(array('required' => false)),
      'ds_marketing'     => new sfValidatorPass(array('required' => false)),
      'ds_twitter'       => new sfValidatorPass(array('required' => false)),
      'ds_facebook'      => new sfValidatorPass(array('required' => false)),
      'ds_youtube'       => new sfValidatorPass(array('required' => false)),
      'ds_flickr'        => new sfValidatorPass(array('required' => false)),
      'ds_orkut'         => new sfValidatorPass(array('required' => false)),
      'ds_institucional' => new sfValidatorPass(array('required' => false)),
      'ds_publico'       => new sfValidatorPass(array('required' => false)),
      'ds_destaque'      => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sistema_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Sistema';
  }

  public function getFields()
  {
    return array(
      'id_sistema'       => 'Number',
      'id_sistema_pai'   => 'ForeignKey',
      'nm_sistema'       => 'Text',
      'ds_sobre'         => 'Text',
      'ds_servico'       => 'Text',
      'ds_contato'       => 'Text',
      'ds_marketing'     => 'Text',
      'ds_twitter'       => 'Text',
      'ds_facebook'      => 'Text',
      'ds_youtube'       => 'Text',
      'ds_flickr'        => 'Text',
      'ds_orkut'         => 'Text',
      'ds_institucional' => 'Text',
      'ds_publico'       => 'Text',
      'ds_destaque'      => 'Text',
    );
  }
}